export const numberToString = (num: number) => num.toString()

export function formatDate(input: string | number | Date): string {
  const d = new Date(input)
  const pad = (n: number) => (n < 10 ? `0${n}` : `${n}`)
  const Y = d.getFullYear()
  const M = pad(d.getMonth() + 1)
  const D = pad(d.getDate())
  const h = pad(d.getHours())
  const m = pad(d.getMinutes())
  return `${Y}-${M}-${D} ${h}:${m}`
}
